<template>
	<view>
		<view class="cu-bar bg-white">
			<view class="action">
				<navigator open-type="navigateBack">
					<text class="cuIcon-back text-gray"></text> 返回
				</navigator>
			</view>
			<view class="content text-bold">
				菜单
			</view>
		</view>
		<scroll-view scroll-x class="bg-white nav text-center">
			<view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabList" :key="index"
				@tap="tabSelect" :data-id="index">
				{{item}}
			</view>
		</scroll-view>

		<view class="cu-list menu-avatar">
			<view class="cu-item grayscale" v-for="(item,tow) in recordList" :key="tow"
				:class="[toggleDelay?'animation-slide-bottom':'']" :style="[{animationDelay: (tow + 1)*0.1 + 's'}]">
				<block>
					<view class="cu-avatar radius lg"
						style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big81007.jpg);">
					</view>
					<view class="content">
						<view><text class="text-cut">{{item.Dish_name}}</text></view>
						<view class="text-xs">今日已售：{{item.Dish_num}}</view>
						<view class="text-gray text-sm flex">
							{{item.Dish_status == 1 ? '全部：' : ''}}
							{{item.Dish_status == 2 ? '历史：' : ''}}
							{{item.Dish_status == 3 ? '退单：' : ''}}
							<text class="text-cut">{{item.Dish_}}</text>
						</view>
					</view>
					<view class="action">
						<view class="round "><text class="icon-add"></text></view>
					</view>
				</block>
			</view>
		</view>
	</view>

</template>

<script>
	import recordList from "../../static/js/record.json"
	export default {
		data() {
			return {
				recordList: [],
				tabList: ["进行中", "历史", "退单"],
				TabCur: 1,
				scrollLeft: 0,
				animation: '',
				toggleDelay: false
			}
		},
		onLoad() {
			this.ToggleDelay()
		},
		methods: {
			ToggleDelay() {
				this.toggleDelay = true;
				setTimeout(() => {
					this.toggleDelay = false
				}, 1500)
			},
			tabSelect(e) {
				console.log("showsele", e.currentTarget.dataset.id)
				this.ToggleDelay()
				this.TabCur = e.currentTarget.dataset.id;
				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
			}
		},
		created() {
			this.recordList = recordList.record[0].list1;
		}
	}
</script>

<style lang="less">

</style>
